package com.itlong.cloud.equip.commons;

import com.itlong.cloud.POJO.DTO.common.LimitedDeviceDto;
import com.itlong.cloud.POJO.DTO.property.CloudIntercomChangeLogGetDTO;
import com.itlong.cloud.POJO.PO.DeviceOnlineStatusAlterLogPO;
import com.itlong.cloud.POJO.PO.DeviceRunLogPO;
import com.itlong.cloud.POJO.VO.common.LimitedDeviceVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.UnsupportedEncodingException;

/**
 * <desc>
 *      设备业务暴露接口
 * </desc>
 *
 * @createDate 2020/11/20 17:59
 */
@FeignClient(name = "equip-service")
public interface ICloudDeviceBaseServiceClient {

    /**
     * <desc>
     *      保存受限设备和缓存设备最新更新时间
     * </desc>
     *
     * @param getDTO
     * @return
     * @author caoshuai
     * @createDate 2020/11/20 18:07
     */
    @RequestMapping(path = "/smartCommunity/interface/base/saveLimitedDevice",method = {RequestMethod.POST})
    LimitedDeviceVO saveLimitedDevice(@RequestBody LimitedDeviceDto getDTO) throws UnsupportedEncodingException;

    /**
     * <desc>
     *      保存设备在线状态变更
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/11/24 15:29
     */
    @RequestMapping(path = "/smartCommunity/interface/base/saveDeviceOnlineStatusAlterLog",method = {RequestMethod.POST})
    void saveDeviceOnlineStatusAlterLog(@RequestBody DeviceOnlineStatusAlterLogPO deviceOnlineStatusAlterLogPO);

    /**
     * <desc>
     *      保存设备日志信息
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/12/3 14:17
     */
    @RequestMapping(path = "/smartCommunity/interface/base/saveDeviceRunLog",method = {RequestMethod.POST})
    Integer saveDeviceRunLog(@RequestBody DeviceRunLogPO deviceRunLogPO) throws Exception;

    /**
     * <desc>
     *      修改设备运行日志上传状态
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/12/3 14:17
     */
    @RequestMapping(path = "/smartCommunity/interface/base/updateDeviceRunLog",method = {RequestMethod.POST})
    Integer updateDeviceRunLog(@RequestBody DeviceRunLogPO deviceRunLogPO);

    /**
     * <desc>
     *     获取受限getDTO 获取受限设备总数
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/12/3 14:17
     */
    @RequestMapping(path = "/smartCommunity/interface/base/getLimitDeviceTotalByDTO",method = {RequestMethod.POST})
    Integer getLimitDeviceTotalByDTO(@RequestBody CloudIntercomChangeLogGetDTO getDTO);

    /**
     * <desc>
     *    获取平板受限设备总数
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/12/3 14:17
     */
    @RequestMapping(path = "/smartCommunity/interface/base/getLimitDevicePadTotalBy",method = {RequestMethod.POST})
    Integer getLimitDevicePadTotalBy(@RequestParam("deviceUnique") String deviceUnique);
}
